package com.wyman.context.support;

import com.wyman.factory.support.DefaultListableBeanFactory;
import com.wyman.factory.xml.XmlBeanDefinitionReader;

/**
 * @Author 李伟民
 * @Description
 * @DateTime 2024/12/12 19:10
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{

    @Override
    public void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory,this);
        String[] configLocations = getConfigLocations();
        if(configLocations!=null){
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }

    public abstract String[] getConfigLocations();
}
